package CircuitLogic;
/*
	电路元件中的指针式检流计
 */
public class PointerGalvanometer extends Components
{
	private double realElectricity;


	PointerGalvanometer(double internalR)
	{
		setResistance(internalR);
	}

	public void setRealElectricity(double realElectricity)
	{
		this.realElectricity = realElectricity;
	}

	/*
		示值刻度单位为1e-6
		范围为-20~20
	 */
	public double getIndicatingValue()
	{
		final double range = 20;
		double val;
		val = realElectricity * 1e6;
		if(val>range)
		{
			return range;
		}
		else if(val<-range)
		{
			return -range;
		}
		else
		{
			return val;
		}
	}

}
